var express = require('express');
var bodyParser = require('body-parser')
var router = require('./src/router'); //routes是文件夹  会自动寻找index
var app = express();
var cors = require('cors');
app.use(express.static('public'))
app.use(bodyParser.json()); //获取json
router(app);
app.use(cors());
var server = app.listen(3000, function () {
    console.log("http://localhost:3000")
    console.log("3000 listening")
});
